from _ast import keyword
from time import sleep

from basic.utils.asserts import asserts
from basic.UIParent import UIParent

from commen.page.ann.indexPage import IndexPage
from commen.page.ann.searchPage import searchPage


class SearchCase(UIParent):

    # @classmethod
    # def test_two(self):
    #     IndexPage.clickSearch();
    #     keyevent("BACK")

    @classmethod
    def test_hotSearch(self):
        '''热门搜索点击结果校验'''
        ##搜索
        IndexPage.clickIndex()
        searchPage.clickSearch()
        searchPage.clickhotSearch()
        sleep(3)
        # searchPage.getAppName()
        listText = searchPage.getAppName()
        # aa = searchPage.getAppName()
        # r=False
        # if "行驶证电子信息" in listText:
        #     r=True
        # assert_equal(r, True, "搜索结果异常")
        asserts.contain("公积金", listText, "热门搜索点击公积金结果")
